import { createRouter, createWebHistory } from "vue-router"
import index from "../views/index/index.vue"
const routes = [
    {
        path: '/',
        component: index,
        redirect: '/recommend',
        children: [
            {
                path: '/recommend',
                component: () => import('../views/index/recommend.vue')
            },
            {
                path: '/follow',
                component: () => import('../views/index/follow.vue')
            },
            {
                path: '/hot',
                component: () => import('../views/index/hot.vue')
            },
            {
                path: '/search/:key',
                component: () => import('../views/index/search.vue')

            }
        ]
    },
    {
        path: '/message',
        component: () => import('../views/mine/index.vue')
    }

]

const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router